<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Controller_Calendar extends Controller_Template {
	public function actionIndex() {
		$this->template->title = "CHAMBER CALENDAR-".$this->settings['title'];
		$this->template->content = new View('calendar/index');
		$content = Model::factory('directory')->getItemByToken('f70', 'text');
		$this->template->content->calendarHeader = $content;
		$items = Model::factory('directory')->getItems('calendar', 'position', 'ASC');
		if(!$items) {
			$this->template->content->error = "Events not found";
		}
		$this->template->content->items = $items;
		
		$this->template->content->imgPath = "/content/directory/images/";
		$images = Model::factory('directory')->getImagesByItem('calendar');
		$this->template->content->images = $images;
	}

	public function actionList()
	{
		$this->template->title = 'EVENTS CALENDAR - ' . $this->settings['title'];
		$this->template->content = new View('iframe', array('page' => 'events'));
	}
}
?>
